import request from '@/utils/request'

export function getPage(query) {
  return request({
    url: '/web-api/business/task/listPage',
    method: 'get',
    params: query
  })
}

export function getList(query) {
  return request({
    url: '/web-api/business/task/list',
    method: 'get',
    params: query
  })
}

export function getById(id) {
  return request({
    url: '/web-api/business/task/' + id,
    method: 'get'
  })
}

export function getMaintenanceById(no) {
  return request({
    url: '/web-api/business/task/maintenance/' + no,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: '/web-api/business/task',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: '/web-api/business/task/' + ids,
    method: 'delete'
  })
}

export function edit(data) {
  return request({
    url: '/web-api/business/task',
    method: 'put',
    data
  })
}
export function batchReview(data) {
  return request({
    url: '/web-api/business/task/batchReview',
    method: 'put',
    data
  })
}
export function review(data) {
  return request({
    url: '/web-api/business/task/review',
    method: 'put',
    data
  })
}

export function read(data) {
  return request({
    url: '/web-api/business/task/read',
    method: 'put',
    data
  })
}

export function report(data) {
  return request({
    url: '/web-api/business/task/report',
    method: 'put',
    data
  })
}

export function revoke(id) {
  return request({
    url: '/web-api/business/task/revoke/' + id,
    method: 'put'
  })
}

export function batchUrge(ids) {
  return request({
    url: '/web-api/business/task/batchUrge/' + ids,
    method: 'put'
  })
}

export function download(query) {
  return request({
    url: '/web-api/business/task/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
